USE [HR_DB]
GO
if exists(select * from dbo.sysobjects where id = object_id(N'salary_grant')   and   OBJECTPROPERTY(id,   N'IsUserTable')   =   1)   
  drop table salary_grant  
-- =============================================
-- Author:杨洁(kaixuanpisces)
-- Create date: 20090826
-- Description:薪酬发放登记表
-- =============================================
CREATE TABLE [dbo].[salary_grant](
	[sgr_id] [smallint] IDENTITY(1,1) NOT NULL,
	[salary_grant_id] [varchar](30) NULL,
	[salary_standard_id] [varchar](30) NULL,
	[first_kind_id] [char](2) NULL,
	[first_kind_name] [varchar](60) NULL,
	[second_kind_id] [char](2) NULL,
	[second_kind_name] [varchar](60) NULL,
	[third_kind_id] [char](2) NULL,
	[third_kind_name] [varchar](60) NULL,
	[human_amount] [smallint] NULL,
	[salary_standard_sum] [money] NULL,
	[salary_paid_sum] [money] NULL,
	[register] [int] NULL,
	[regist_time] [datetime] NULL,
	[checker] [int] NULL,
	[check_time] [datetime] NULL,
	[check_status] [smallint] NULL,
 CONSTRAINT [salary_grant_PK] PRIMARY KEY CLUSTERED 
(
	[sgr_id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
-- ==============================================
-- 列名说明
-- ==============================================
GO
SET ANSI_PADDING OFF
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'主键，自动增长列' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'sgr_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'薪酬发放编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'salary_grant_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'薪酬标准单编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'salary_standard_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一级机构编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'first_kind_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'一级机构名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'first_kind_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'二级机构编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'second_kind_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'二级机构名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'second_kind_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'三级机构编号' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'third_kind_id'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'三级机构名称' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'third_kind_name'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'总人数' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'human_amount'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'标准薪酬总金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'salary_standard_sum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'实发总金额' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'salary_paid_sum'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登记人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'register'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'登记时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'regist_time'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'复核人' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'checker'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'复核时间' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'check_time'
GO
EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'复核状态' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'salary_grant', @level2type=N'COLUMN',@level2name=N'check_status'